<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var sum = (...args) => {
            var sum = 0;
            args.forEach(item => {
                sum += item;
            })
            return sum;
        }
        console.log(sum(1, 2, 3));
        console.log(sum(1, 2));


        var arr = ["zansna", 'lisi', 'wangwu'];
        var [s1, ...s2] = arr;
        console.log(s1);
        console.log(s2);
    </script>
</body>

</html>